import com.service.buy;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.transaction.event.TransactionalEventListener;

public class test {
    @Test
    public  void test1(){
        ApplicationContext ac=new ClassPathXmlApplicationContext("" +
                "spring.xml");
        buy buy= (com.service.buy) ac.getBean("buyImpl");
        System.out.println(buy.getClass().getName());
        buy.find();
        try {
            buy.buy(1002,1);
        }catch (Exception e){
            e.printStackTrace();
        }
        buy.find();
    }
}
